package com.clkj.cldisabledmanclient.util;

import android.content.Context;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;
import com.youth.banner.loader.ImageLoader;

/**
 * Created by clboys on 2018/6/27.
 */

public class GlideBannerImageLoader extends ImageLoader {
    @Override
    public void displayImage(Context context, Object path, ImageView imageView) {
        //Picasso 加载图片简单用法
        if (path instanceof String)
            Picasso.get()
                .load((String)path).fit().centerCrop().into(imageView);
        else Picasso.get().load((int)path).fit().centerCrop().into(imageView);

      /*  int width = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth();


        RequestOptions requestOptions = new RequestOptions().override(width, DensityUtil.dp2px(context, 200))
                .error(R.mipmap.ico_data_empty).centerCrop()
                .placeholder(R.mipmap.ico_data_empty);
        if (path instanceof String) {
            Glide.with(context)
                    .load((String) path)
                    .apply(requestOptions)
                    .into(imageView);
        } else {
            Glide.with(context)
                    .load((int) path)
                    .apply(requestOptions)
                    .into(imageView);
        }*/

    }


}